using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class CH_chartMap : EntityTypeConfiguration<CH_chart>
    {
        public CH_chartMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            // Table & Column Mappings
            this.ToTable("CH_chart");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.PatientIID).HasColumnName("PatientIID");
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            this.Property(t => t.CreateUser).HasColumnName("CreateUser");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.PageID).HasColumnName("PageID");

            // Relationships
            this.HasOptional(t => t.frm_page2)
                .WithMany(t => t.CH_chart)
                .HasForeignKey(d => d.PageID);

        }
    }
}
